package com.wgchao.pharmacymg.domain.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @作者  wgchao
 * @时间 2019-11-17 
 * @用途 药库
 */

@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@Table ( name ="ph_drug_storage" )
public class PhDrugStorageDO  implements Serializable {

	private static final long serialVersionUID =  7808983416879588456L;

	/**
	 * 药库编号
	 */
	@Id
   	@Column(name = "storage_code" )
	private String storageCode;

	/**
	 * 药库名称
	 */
   	@Column(name = "storage_name" )
	private String storageName;

	/**
	 * 机构编号
	 */
	@Column(name = "agency_code" )
	private String agencyCode;

	/**
	 * 凭证号
	 */
   	@Column(name = "pzh" )
	private String pzh;

	/**
	 * 药库分类
	 */
   	@Column(name = "dsl" )
	private Long dsl;

	/**
	 * 创建时间
	 */
	@Column(name = "create_time" )
   	private Date createTime;

	/**
	 * 删除标志
	 */
	@Column(name = "del" )
   	private boolean del;

	/**
	 * 删除时间
	 */
	@Column(name = "del_time" )
   	private Date delTime;

	public void save(){
		this.del = false;
		this.createTime = new Date();
	}

	public void delete(){
		this.del = true;
		this.delTime = new Date();
	}

}
